/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __LCD_H
#define __LCD_H
#include "stm32f10x.h"
#include "Globals.h"
#define WIFI_CONNECTED   					0X02
#define WIFI_DISCONNECTED   			0X00

#define SERVER_CONNECTED   							0X01
#define SERVER_DISCONNECTED   					0X00

#define PAGEID_0_HOME   												0X00
#define PAGEID_1_MONITOR   											0X01
#define PAGEID_2_STIMULATION_PARAMER_SETTING   	0X02
#define PAGEID_3_PARAMETERS_SETTING   					0X03
//page 4 5 6 auto display by LCD
#define PAGEID_7_NETWORK_SETTING  							0X07
#define PAGEID_8_DATA_SETTING   								0X08
#define PAGEID_9_FACTORY_SETTING  							0X09
#define PAGEID_10_NET_CONNECTING  							0X0A
#define PAGEID_11_CONNECT_STATE  							  0X0B
/*****************about stimulate parameters**********************************************/
#define VARIABLE_ADDR_0_HOME															0X60
#define VARIABLE_ADDR_1_MONITOR														0X61
#define VARIABLE_ADDR_2_STIMULATION_PARAMETERS_SETTING  	0X62
#define VARIABLE_ADDR_3_PARAMETERS_SETTTING								0X63
#define VARIABLE_ADDR_7_NETWORK_SETTING										0X67
#define VARIABLE_ADDR_8_DATA_SETTING											0X68
#define VARIABLE_ADDR_9_FACTORY_SETTING										0X69


#define LCD_SPO2VarAddress  							0x20
#define LCD_HRVarAddress  								0x21
#define LCD_EndTimeHourVarAddress  				0x22
#define LCD_EndTimeMinVarAddress  				0x23
#define LCD_DelayTimeVarAddress  					0x24
#define LCD_StrengthVarAddress  					0x25

#define LCD_StimulationIconVarAddress  				0x30
#define LCD_SDCardIconVarAddress  						0x32
#define LCD_NetConnectingIconVarAddress  			0x34
#define LCD_WifiIconVarAddress  							0x40
#define LCD_WaveNameIconVarAddress  					0x41
#define LCD_SetNameIconOnKeyBoardVarAddress  	0x42
#define LCD_NetConnectStateIconVarAddress  		0x43
/*****************about network parameters**********************************************/
#define VARIABLE_ADDR_7_SERVERIP_FIRST										0X26
#define VARIABLE_ADDR_7_SERVERIP_SECEND										0X27
#define VARIABLE_ADDR_7_SERVERIP_THIRD										0X28
#define VARIABLE_ADDR_7_SERVERIP_FOURTH										0X29
#define VARIABLE_ADDR_7_SERVER_PORT												0X2A
/*****************about device ID parameters**********************************************/
#define TXT_VARIABLE_ADDR_7_NETWORK_NAME									0X70
#define TXT_VARIABLE_ADDR_7_PASSWORD											0X80
#define TXT_VARIABLE_ADDR_9_DEVICE_ID											0X90
/*****************about slave command**********************************************/
#define Slave_StartTreatmentCmd  					0x85
#define Slave_StopTreatmentCmd  					0x86
#define Slave_OverCurrentCmd  						0x87
#define Slave_AdjustStrengthCmd  					0x88
/*****************data variable address define**********************************************/


#define LCD_BAUDRATE  115200

void LCD_uart_Config(void);
void LCD_SendPlethDat(u8 pledtDat);
void LCD_GetRTC(void);
void LCD_Clear(void);
void  LCD_GetVariableValueCmd(u8 variableAddress);
void  LCD_TurnToThePage(u8 pageID);
void LCD_DisplayDeviceID(void);
void LCD_ShowText(u8 textVariableAddr,u8 *textBuffer,u8 textBufferLength);
void LCD_SetVariableValue(u8 variableAddress,u16 variableValue);
void LCD_SetPortValue(u16 port);
void LCD_DisplayNetworkParameters(struct NetworkParametersType lcdNetworkParameters);
void LCD_DisplayStimulationParameters(struct StimulationParametersType stimulationParametersTemp);

#endif
